<?php
/**
 * Created by PhpStorm.
 * User: august
 * Date: 2021/5/18
 * Time: 16:03
 */

namespace DesignPatterns\Creator\Prototype;


class Drive
{
    /**
     * @var Car
     */
    public $car;

    public function __construct()
    {
        echo "准备完成\n";
    }

    public function setCar($car)
    {
        $this->car = $car;
    }

    public function show()
    {
        echo "我正在驾驶 " . $this->car->name . "\n";
    }

    // public function __clone()
    // {
    //     $this->car = clone $this->car;
    // }
}